package com.generic.action;

import java.util.List;

import com.generic.dao.impl.MemberDao;
import com.generic.ds.HibernateSession;
import com.opensymphony.xwork2.ActionSupport;

public class Home extends ActionSupport {
	
	private static final long serialVersionUID = 2116030705024469408L;
	private List<Object[]> members;
	
	
	public List<Object[]> getMembers() {
		return members;
	}

	public void setMembers(List<Object[]> members) {
		this.members = members;
	}

	public String execute() {
		HibernateSession hs = new HibernateSession();
		try {
			MemberDao memberDao = new MemberDao(hs);
			members = memberDao.list();
		} catch (Exception e) {
			hs.rollbackTransaction(e);
		} finally {
			hs.closeSession();
		}
		
		return SUCCESS;
	}
}
